﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IXmlNodesCollection : IEnumerator<IXmlNode>, IEnumerable<IXmlNode>
    {
        /// <summary>
        /// 添加节点
        /// </summary>
        /// <param name="text"></param>
        IXmlNode Add(string elementName);

        /// <summary>
        /// 添加节点
        /// </summary>
        /// <param name="text"></param>
        IXmlNode Add(string elementName, string text);

        /// <summary>
        /// 允许重复添加
        /// </summary>
        /// <param name="node"></param>
        void Add(IXmlNode node);

        /// <summary>
        /// 根据位置获取节点集合
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        IXmlNode this[int index] { get;}

        /// <summary>
        /// 根据名称获取节点集合
        /// </summary>
        /// <param name="elementName"></param>
        /// <returns></returns>
        IXmlNodesCollection this[string elementName] { get;}

        /// <summary>
        /// 获取长度
        /// </summary>
        int Count { get;}

        /// <summary>
        /// 是否包含element
        /// </summary>
        /// <param name="elementName"></param>
        /// <returns></returns>
        bool Contains(string elementName);

        /// <summary>
        /// 移除某个节点集合
        /// </summary>
        /// <param name="elementName"></param>
        IXmlNodesCollection Remove(string elementName);

        /// <summary>
        /// 清空
        /// </summary>
        void Clear();
    }
}
